<?php
/**
 * @Name: OpenController.php
 * @Author: yashuai 1762910894@qq.com
 * 获取jssdk的signature
 */

namespace App\Http\Controllers;

use HugCode\WeChat\Offiaccount\OAWebApps\JsSdk;
use App\Http\Services\AccessTokenServices;

class OpenController
{

    /**
     * @Desc 获取jssdk的signature
     * @author yashuai 1762910894@qq.com
     */
    public function getSignature(Request $request)
    {
        $params    = $request->all();
        $config    = AccessTokenServices::getAccessToken();
        $ticket    = AccessTokenServices::getJsApiTicket($config);
        return (new JsSdk($config))->getSignature($params['url'], $ticket);
    }

}
